package com.weather.business.service.impl;

import java.util.List;
import com.weather.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.weather.business.mapper.WeatherDataMapper;
import com.weather.business.domain.WeatherData;
import com.weather.business.service.IWeatherDataService;

/**
 * 城市天气Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-15
 */
@Service
public class WeatherDataServiceImpl implements IWeatherDataService
{
    @Autowired
    private WeatherDataMapper weatherDataMapper;

    /**
     * 查询城市天气
     *
     * @param id 城市天气主键
     * @return 城市天气
     */
    @Override
    public WeatherData selectWeatherDataById(Long id)
    {
        return weatherDataMapper.selectWeatherDataById(id);
    }

    /**
     * 查询城市天气列表
     *
     * @param weatherData 城市天气
     * @return 城市天气
     */
    @Override
    public List<WeatherData> selectWeatherDataList(WeatherData weatherData)
    {
        return weatherDataMapper.selectWeatherDataList(weatherData);
    }

    /**
     * 查询城市天气列表
     *
     * @param weatherData 城市天气
     * @return 城市天气
     */
    @Override
    public List<WeatherData> selectWeatherDataAllList(WeatherData weatherData)
    {
        return weatherDataMapper.selectWeatherDataAllList(weatherData);
    }

    /**
     * 新增城市天气
     *
     * @param weatherData 城市天气
     * @return 结果
     */
    @Override
    public int insertWeatherData(WeatherData weatherData)
    {
        return weatherDataMapper.insertWeatherData(weatherData);
    }

    /**
     * 修改城市天气
     *
     * @param weatherData 城市天气
     * @return 结果
     */
    @Override
    public int updateWeatherData(WeatherData weatherData)
    {
        weatherData.setUpdateTime(DateUtils.getNowDate());
        return weatherDataMapper.updateWeatherData(weatherData);
    }

    /**
     * 批量删除城市天气
     *
     * @param ids 需要删除的城市天气主键
     * @return 结果
     */
    @Override
    public int deleteWeatherDataByIds(Long[] ids)
    {
        return weatherDataMapper.deleteWeatherDataByIds(ids);
    }

    /**
     * 删除城市天气信息
     *
     * @param id 城市天气主键
     * @return 结果
     */
    @Override
    public int deleteWeatherDataById(Long id)
    {
        return weatherDataMapper.deleteWeatherDataById(id);
    }
}
